#include <iostream>
#include <string>

#include "StringBad.h"

using namespace std;

void callme1(StringBad &);	// pass by reference
void callme2(StringBad);	// pass by value

int main()
{
	{
		cout << "StringBad an inner block:" << endl;
		StringBad headline1("Celery Stalks at Midnight.");
		StringBad headline2("Lettuce Prey.");
		StringBad sports("Spinach Leaves Bowl for Dollars.");

		cout << "headline1: " << headline1 << endl;
		cout << "headline2: " << headline2 << endl;
		cout << "sports: " << sports << endl;

		callme1(headline1);
		cout << "headline1: " << headline1 << endl;

		callme2(headline2);
		cout << "headline2: " << headline2 << endl;

		cout << "Initialize one object to another:" << endl;
		StringBad sailor = sports;
		cout << "sailor: " << sailor << endl;

		cout << "Assign one object to another:" << endl;
		StringBad knot;
		knot = headline1;
		cout << "knot: " << knot << endl;
		cout << "Exiting the inner block:" << endl;
	}
	return 0;
}

void callme1(StringBad &rsd) {
	cout << "StringBad passed by reference:" << endl;
	cout << "    \"" << rsd << "\"" << endl;
}
void callme2(StringBad sd) {
	cout << "StringBad passed by value:" << endl;
	cout << "    \"" << sd << "\"" << endl;
}